<?php

class kelola_technopreneur{
	
	function __construct(){
			
		$db_config = new db_config();
		
		$link = mysql_connect($db_config->host.':'.$db_config->port, $db_config->db_username, $db_config->db_password);
		
		if (!$link) {
			die('Could not connect: '.mysql_error());
		}
		
		if(!mysql_select_db($db_config->db_name)) {
			die("cannot select db");
		}
		
	}
	
	function select_technopreneur($id){
	
		$sql = '
			SELECT 
				ID_TECHNOPRENEUR, USERNAME, EMAIL_TECHNOPRENEUR, NAMA, NO_TELP, ALAMAT, DESKRIPSI_TECHNOPRENEUR, TANGGAL_JOIN 
			FROM 
				account_technopreneur 
			WHERE 
				ID_TECHNOPRENEUR = '.$id.' 
			LIMIT 1
		';
		
		$query = mysql_query($sql);
		
		return $query;
	
	}
	//by Anindita
	function cariTechnopreneur($cari){
	
		$sql = '
			SELECT 
				* 
			FROM 
				account_technopreneur
			WHERE 
				NAMA like "%'.$cari.'%"
		';
		
		$query = mysql_query($sql);
		
		return $query;
	
	}
	
	//
	
	function delete_technopreneur ($id_techno){
		$sql = '
			DELETE FROM account_technopreneur WHERE ID_TECHNOPRENEUR = '.$id_techno;
	
	$query = mysql_query($sql);
		
		return $query;
	}
}